package com.test.hm;

import java.util.ArrayList;
import java.util.Collections;
import java.util.EmptyStackException;
import java.util.HashMap;
import java.util.Hashtable;
import java.util.List;
import java.util.Map;
import java.util.Stack;

public class StackDemo {

	static void showpush(Stack st,int a){
		st.push(new Integer(a));
		System.out.println("push("+a+")");
		System.out.println("stack:"+st);
	}
	
	static void showpop(Stack st){
		System.out.println("pop->");
		Integer a = (Integer)st.pop();
		System.out.println(a);
		System.out.println("stack:"+st);
	}
	
	public static void main(String[] args) {
		Stack st = new Stack();
		System.out.println("stack:"+st);
		showpush(st, 42);
		showpush(st, 66);
		showpush(st, 99);
		showpop(st);
		showpop(st);
		showpop(st);
		try {
			showpop(st);
		} catch (EmptyStackException e) {
			System.out.println("empty stack");
		}
		
		HashMap hm = new HashMap();
		Hashtable ht = new Hashtable();
		Map m = Collections.synchronizedMap(hm);
		List liTest = new ArrayList();
		ArrayList al = new ArrayList();
	}

}


























